.app-header {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  box-shadow: var(--shadow-2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  /* 确保内容垂直居中对齐 */
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  height: 32px;
}

.app-logo {
  height: 32px;
  width: 32px;
  margin-right: 12px;
  border-radius: var(--border-radius-lg);
}

.app-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  margin: 0;
  /* 确保标题垂直居中 */
  display: flex;
  align-items: center;
  height: 32px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  /* 确保所有子元素垂直居中对齐 */
  align-items: center;
  /* 确保子元素高度一致 */
  height: 32px;
}

/* 语言选择器样式优化 */
.arco-select {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  /* 确保选择器垂直居中 */
  align-self: center;
  height: 32px;
  /* 确保选择器内容垂直居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
}

.arco-select:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.5);
}

.arco-select-view {
  background-color: transparent;
  border: none;
  color: var(--color-primary);
  /* 确保文本垂直居中 */
  display: flex;
  align-items: center;
  height: 100%;
  /* 确保内部文本垂直居中 */
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  /* 确保内部内容垂直居中 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.arco-select-view:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.arco-select-view-value {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 13px;
}

.arco-select-arrow-icon {
  color: var(--color-primary);
  font-size: 12px;
}

/* 自定义登录按钮样式 */
.custom-login-button {
  background-color: white;
  color: var(--color-primary);
  border: none;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* 确保按钮垂直居中 */
  align-self: center;
  height: 32px;
  /* 确保按钮内容垂直居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg);
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13px;
}

.custom-login-button:hover {
  background-color: #f0f0f0;
  color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-login-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* 用户信息区域样式 */
.user-info {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-width: 120px;
  justify-content: space-between;
  height: 32px;
}

.user-profile:hover {
  background-color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.username {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 13px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-icon {
  color: var(--color-primary);
  font-size: 10px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.dropdown-icon.rotated {
  transform: rotate(180deg);
}

/* 用户头像样式 */
.arco-avatar {
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  width: 20px;
  height: 20px;
  line-height: 20px;
}

/* 简单下拉菜单样式 */
.simple-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.04);
  min-width: 140px;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.simple-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.simple-dropdown-menu {
  padding: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.dropdown-item:hover {
  background-color: #f8f8f8;
  color: var(--color-primary);
  padding-left: 18px;
  transform: translateX(2px);
}

.dropdown-item svg {
  width: 14px;
  height: 14px;
  margin-right: 8px;
  transition: all 0.15s ease;
}

.dropdown-item:hover svg {
  color: var(--color-primary);
  transform: translateX(2px);
}

.dropdown-item.logout-item {
  color: #ff4d4f;
}

.dropdown-item.logout-item:hover {
  background-color: #fff2f0;
  color: #ff4d4f;
  padding-left: 18px;
  transform: translateX(2px);
}

.dropdown-item.logout-item:hover svg {
  color: #ff4d4f;
  transform: translateX(2px);
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 0;
}

/* 下拉菜单箭头指示器 */
.simple-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  transform: rotate(45deg);
  z-index: -1;
}

/* 下拉菜单样式 */
.arco-dropdown {
  margin-top: 4px;
}

.arco-menu {
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border-2);
  overflow: hidden;
}

.arco-menu-item {
  padding: 12px 16px;
  font-size: var(--font-size-sm);
  transition: all 0.2s ease;
}

.arco-menu-item:hover {
  background-color: var(--color-fill-2);
  color: var(--color-primary);
}

.arco-menu-item-selected {
  background-color: var(--color-primary-light-1);
  color: var(--color-primary);
}

.arco-menu-divider {
  margin: 4px 0;
  background-color: var(--color-border-2);
}

/* 加载按钮样式 */
.arco-btn-loading {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-lg);
  height: 32px;
  font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    padding: 0 16px;
  }
  
  .app-title {
    font-size: 16px;
  }
  
  .username {
    max-width: 60px;
  }
  
  .user-profile {
    min-width: 100px;
    padding: 4px 10px;
    height: 32px;
  }
  
  .arco-select {
    height: 32px;
    min-width: 90px;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 12px;
  }
  
  .app-logo {
    height: 28px;
    width: 28px;
    margin-right: 8px;
  }
  
  .app-title {
    font-size: 13px;
  }
  
  .username {
    display: none;
  }
  
  .user-profile {
    min-width: auto;
    padding: 4px 8px;
    height: 28px;
  }
  
  .arco-select {
    height: 32px;
    min-width: 80px;
  }
}

/* 暗色主题适配 */
[data-theme='dark'] .user-profile {
  background-color: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .user-profile:hover {
  background-color: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme='dark'] .username {
  color: white;
}

[data-theme='dark'] .dropdown-icon {
  color: white;
}

[data-theme='dark'] .arco-avatar {
  border-color: rgba(255, 255, 255, 0.3);
}

/* 暗色主题下拉菜单适配 */
[data-theme='dark'] .simple-dropdown {
  background-color: rgba(45, 45, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme='dark'] .dropdown-item {
  color: #f0f0f0;
}

[data-theme='dark'] .dropdown-item:hover {
  background-color: #3d3d3d;
  color: #ffffff;
  transform: translateX(2px);
}

[data-theme='dark'] .dropdown-item.logout-item:hover {
  background-color: #3a1f1f;
  color: #ff7875;
  transform: translateX(2px);
}
